package route;

public class Segment {
	private Station station;
	private double distance;

	

	public Segment(Station station, double distance) {
		this.station = station;
		this.distance = distance;
	}

	public boolean passAcross(String roadName) {
		return this.station.passAcross(roadName);
	}

	@Override
	public String toString() {

		return this.station + " : " + this.distance;
	}

	@Override
	public boolean equals(Object o) {
		if (o == null || o instanceof Segment)
			return false;
		else {
			return this.station.equals(station)
					&& this.distance == distance;
		}
		
	}

	public double getDistance() {
		return distance;
	}

}
